package com.zhss.eshop.order.price.freight;


import com.zhss.eshop.order.domain.dto.OrderInfoDTO;
import com.zhss.eshop.order.domain.dto.OrderItemDTO;
import com.zhss.eshop.order.price.promotion.PromotionActivityResult;
import org.springframework.stereotype.Component;

/**
 * 含赠品的运费计算组件
 * @author suyuan
 *
 */
@Component
public class GiftIncludedFreightCalculator implements FreightCalculator {

	/**
	 * 物流中心接口
	 */
//	@Autowired
//	private LogisticsService logisticsService;

	/**
	 * 计算运费
	 */
	@Override
	public Double calculate(OrderInfoDTO order, OrderItemDTO orderItem,
							PromotionActivityResult result) {
		Double freight = 0.0;

//		freight += logisticsService.calculateFreight(order, orderItem);
//
//		for(OrderItemDTO giftItem : result.getOrderItems()) {
//			freight += logisticsService.calculateFreight(order, giftItem);
//		}

		return freight;
	}

}
